<div class="row">
    <p id="list-title">{{.PageName}}</p>
</div>

<form id="teamForm" action="{{.URL}}{{.RecordID}}?action={{.Action}}" method="post" class="post-form form-horizontal {{if .Readonly}}form-disabled{{else}}form-edit{{end}}" role="form">
    <div class="row title-action">
        {{if .RecordID}} {{if .Readonly}}
        <a href="{{.URL}}{{.RecordID}}?action=edit" class="btn btn-success fa fa-pencil pull-left form-edit-btn">&nbsp编辑</a>
        <a href="{{.URL}}?action=create" type="buttom" class="btn btn-success fa fa-plus pull-left form-create-btn">&nbsp新建</a>{{end}}{{end}}
        <button type="submit" form="teamForm" class="btn btn-primary fa fa-save pull-left form-save-btn">&nbsp保存</button> {{if .Readonly}}
        <button type="button" class="btn btn-danger fa fa-remove  pull-left form-cancel-btn">&nbsp取消</button> {{else}}
        <a href="{{.URL}}" class="btn btn-danger fa fa-remove  pull-left">&nbsp取消</a> {{end}}
        <a href="{{.URL}}" class="btn btn-info fa fa-list pull-left">&nbsp列表</a>
    </div>
    {{ .xsrf }} {{if .RecordID}}
    <input type="hidden" data-type="int" class="{{.FormField}}" name="recordID" id="record-id" value="{{.RecordID}}"> {{end}}

    <div class="row">
        <div class="col-md-6">
            <fieldset>
                <legend>基本信息</legend>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label for="company" class="col-md-4 control-label label-start">所属公司<span class="required-input">&nbsp*</span></label>
                            <div class="col-md-8">
                                <p class="p-form-control"> {{if and .Team .Team.Company}} {{.Team.Company.Name}}{{end}}</p>
                                <select data-type="int" name="Company" id="company" class="{{.FormField}} form-control select-company">
                                    {{if and .Team .Team.Company}}
                                    <option value="{{.Team.Company.ID}}" selected="selected">{{.Team.Company.Name}}</option>
                                    {{else}}
                                    <option value="{{.LoginUser.Company.ID}}" selected="selected">{{.LoginUser.Company.Name}}</option>
                                    {{end}} 
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label for="name" class="col-md-4 control-label label-start">团队名称<span class="required-input">&nbsp*</span></label>
                            <div class="col-md-8">
                                <p class="p-form-control">{{if .Team}} {{.Team.Name}} {{end}}</p>
                                <input data-type="string" class="{{.FormField}} form-control" name="Name" type="text" {{if .Team}} value="{{.Team.Name}}" {{end}} />
                            </div>
                        </div>
                    </div>

                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label for="leader" class="col-md-4 control-label label-start">负责人<span class="required-input">&nbsp*</span></label>
                            <div class="col-md-8">
                                <p class="p-form-control"> {{if .Team }} {{.Team.Leader.Name}}{{end}}</p>
                                <select data-type="int" name="Leader" id="leader" class="{{.FormField}} form-control select-user">
                             {{if  .Team }}
                            <option value="{{.Team.Leader.ID}}" selected="selected">{{.Team.Leader.Name}}</option>
                             {{end}} 
                        </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label for="department" class="col-md-4 control-label label-start">所属部门</label>
                            <div class="col-md-8">
                                <p class="p-form-control"> {{if and .Team .Team.Department}} {{.Team.Department.Name}}{{end}}</p>
                                <select data-type="int" name="Department" id="department" class="{{.FormField}} form-control select-department">
                             {{if and .Team .Team.Department}}
                            <option value="{{.Team.Department.ID}}" selected="selected">{{.Team.Department.Name}}</option>
                             {{end}} 
                        </select>
                            </div>
                        </div>
                    </div>
                </div>
            </fieldset>
        </div>
        <div class="col-md-6">
            <fieldset>
                <legend>描述信息</legend>
                <div class="row">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label for="description" class="col-md-2 control-label label-start">描述</label>
                            <div class="col-md-10">
                                <p class="p-form-control">{{if .Team}} {{.Team.Description}} {{end}}</p>
                                <textarea data-type="string" class="{{.FormField}}  form-control" id="description" name="Description" rows="5" placeholder="请输入街道信息">{{if .Team}}  {{.Team.Description}} {{end}}</textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </fieldset>
        </div>
    </div>

</form>